import { BrowserRouter, Routes,Route,useRoutes} from'react-router-dom'

import { lazy } from 'react'


// import Layout from '../pages/layout/Layout.jsx'
// import Home from '../pages/home/home.jsx'
// import { Children } from 'react'
// import NotFound from '../pages/404/index.jsx'

const Layout = lazy(()=>import('../pages/layout/Layout.jsx'))
const Home = lazy(()=>import('../pages/home/home.jsx'))
const NotFound = lazy(()=>import('../pages/404/index.jsx'))

const routesList = [
    {
        path:'*',
        element:<NotFound/>
    },
    {
        path:'/',
        element:<Layout/>,
        children:[
           {
            path:'home',
            element:<Home/>
           },
           {
            path:'',
            element:<Home/>
           }
    ]
        
    },
   
    
]

function WrapperRoutes(){
    let element = useRoutes(routesList) // <Route path='' element={}></Route>
    return element
}


export default WrapperRoutes